package com.dxq.test.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;
import java.util.List;

/**
 * Author: zsh
 * Date: 2023/10/17
 * Describe: 牲畜蓝牙标签表（字段）
 */
@DatabaseTable(tableName = "Label")
public class Label implements Serializable {

    public final static String ID_FIELD_NAME = "label_id";

    // id = true:表明这个字段是这条记录的唯一标志符, generatedId = true:表明自动增加的ID
    //序号
    @DatabaseField(generatedId = true, columnName = ID_FIELD_NAME)
    private int label_id;

    @DatabaseField(columnName = "serialNumber")
    private String serialNumber;//序号

    //基本信息
    @DatabaseField(columnName = "name")
    private String name;//名称

    @DatabaseField(columnName = "sex")
    private String sex;//性别

    @DatabaseField(columnName = "weight")
    private String weight;//体重

    @DatabaseField(columnName = "breedingStatus")
    private String breedingStatus;//繁殖状态

    @DatabaseField(columnName = "type")
    private String type;//种类0-牛，1-羊，2-禽类

    //标签信息
    @DatabaseField(columnName = "ID")
    private String ID;//序号

    @DatabaseField(columnName = "QRCodeID")
    private String QRCodeID;//二维码

    @DatabaseField(columnName = "batteryLevel")
    private String batteryLevel;//电池电量

    @DatabaseField(columnName = "temperature")
    private String temperature;//温度

    @DatabaseField(columnName = "ExerciseSteps")
    private String ExerciseSteps;//运动步数

    //牧场--外键
    @DatabaseField(columnName = "pasture_id", foreign = true, foreignAutoRefresh = true, foreignAutoCreate = true)
    private Pasture pasture_id;//序号

    @DatabaseField(persisted = false)//如果设置为false，表示这个字段不会写到数据库中
    private boolean isCheck;//是否选中

    @DatabaseField(persisted = false)//如果设置为false，表示这个字段不会写到数据库中
    private boolean isExist;//是否存在

    public Label() {
    }

    public Label(String serialNumber, String name, String sex, String weight, String breedingStatus,
                 String type, String ID, String QRCodeID, String batteryLevel, String temperature,
                 String exerciseSteps, Pasture pasture_id) {
        this.serialNumber = serialNumber;
        this.name = name;
        this.sex = sex;
        this.weight = weight;
        this.breedingStatus = breedingStatus;
        this.type = type;
        this.ID = ID;
        this.QRCodeID = QRCodeID;
        this.batteryLevel = batteryLevel;
        this.temperature = temperature;
        ExerciseSteps = exerciseSteps;
        this.pasture_id = pasture_id;
    }

    public int getLabel_id() {
        return label_id;
    }

    public void setLabel_id(int label_id) {
        this.label_id = label_id;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getBreedingStatus() {
        return breedingStatus;
    }

    public void setBreedingStatus(String breedingStatus) {
        this.breedingStatus = breedingStatus;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getQRCodeID() {
        return QRCodeID;
    }

    public void setQRCodeID(String QRCodeID) {
        this.QRCodeID = QRCodeID;
    }

    public String getBatteryLevel() {
        return batteryLevel;
    }

    public void setBatteryLevel(String batteryLevel) {
        this.batteryLevel = batteryLevel;
    }

    public String getTemperature() {
        return temperature;
    }

    public void setTemperature(String temperature) {
        this.temperature = temperature;
    }

    public String getExerciseSteps() {
        return ExerciseSteps;
    }

    public void setExerciseSteps(String exerciseSteps) {
        ExerciseSteps = exerciseSteps;
    }

    public Pasture getPasture_id() {
        return pasture_id;
    }

    public void setPasture_id(Pasture pasture_id) {
        this.pasture_id = pasture_id;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public boolean isExist() {
        return isExist;
    }

    public void setExist(boolean exist) {
        isExist = exist;
    }

    @Override
    public String toString() {
        return "Label{" +
                "label_id=" + label_id +
                ", serialNumber='" + serialNumber + '\'' +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", weight='" + weight + '\'' +
                ", breedingStatus='" + breedingStatus + '\'' +
                ", type='" + type + '\'' +
                ", ID='" + ID + '\'' +
                ", QRCodeID='" + QRCodeID + '\'' +
                ", batteryLevel='" + batteryLevel + '\'' +
                ", temperature='" + temperature + '\'' +
                ", ExerciseSteps='" + ExerciseSteps + '\'' +
                ", pasture_id=" + pasture_id +
                '}';
    }
}
